/*************************************************************************
	> File Name: P1705.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-09 14:40:28
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 30

int arr[MAX_N + 5];
int m, r, n, cnt = 0;

void dfs(int k, int start, int sum) {
    if (k == r + 1) {
        cnt += (sum > n);
        return ;
    }
    for (int i = start; i <= m; i++) {
        dfs(k + 1, i + 1, sum + arr[i]);
    }
    return ;
}

int main() {
    cin >> m >> r >> n;
    for (int i = 1; i <= m; i++) {
        cin >> arr[i];
    }
    dfs(1, 1, 0);
    cout << cnt << endl;
    return 0;
}
